package java6681.lesson13;

/**
 * @author Junichiro
 * @description 实现Runnable接口创建线程任务类
 * @date 2021-06-05 18:57
 **/

public class TicketRunnable6681 implements Runnable{
    private int tickets = 1;
    @Override
    public void run() {
        while(true){
            if (tickets <= 8){
                System.out.println(Thread.currentThread().getName()+
                        "已售出第"+tickets++ +"张票");
            }
        }
    }
}
